package com.jinzhi.jzweb.dao;

import com.baomidou.mybatisplus.plugins.Page;
import com.jinzhi.common.base.BaseDao;
import com.jinzhi.jzweb.domain.CertificationBatchDO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 
 * <pre>
 * 认证批次
 * </pre>
 * <small> 2020-02-24 21:00:12 | lance</small>
 */
public interface CertificationBatchDao extends BaseDao<CertificationBatchDO> {

    List<Map<Object,Object>> selTimeAll();

    List<Map<Object,Object>> selTimeAllSecond(@Param("day") Integer day);

    Map<Object,Object> selDetail(@Param("id") Long id);

    List<Map<Object,Object>> selByNameId();

    @Select("select *, end_time as endTime from jz_certification_batch where state = 0 and end_time > NOW() and start_time < NOW()")
    List<CertificationBatchDO> findListPage(Page<CertificationBatchDO> page);

    @Select("select * from jz_certification_batch where state = 0")
    List<CertificationBatchDO> findList();

    List<Map<Object,Object>> selDaysAll(@Param("day") Integer day);

    List<Map<Object,Object>> selCbatchList(Page<Map<Object,Object>> page,@Param("name") String name);

    Integer selCbatchCount(@Param("id")Long id);
}
